import {defineStore} from "pinia";
import {ref} from "vue";

export const useProgressStore = defineStore('progress', () => {
        const progress = ref({
            messageCollected: 0,
            roomSelected: 0,
            payed: 0,
            goodsGeted: 0
        })

        const setProgressM = (value) => {
            progress.value.messageCollected = value
        }
        const setProgressR = (value) => {
            progress.value.roomSelected = value
        }
        const setProgressP = (value) => {
            progress.value.payed = value
        }
        const setProgressG = (value) => {
            progress.value.goodsGeted = value
        }
        const getProgress = () => {
            return progress.value
        }
        const resetProgress = () => {
            progress.value = {
                messageCollected: 0,
                roomSelected: 0,
                payed: 0,
                goodsGeted: 0
            }
        }
        return {
            progress,
            setProgressM,
            setProgressR,
            setProgressP,
            setProgressG,
            getProgress,
            resetProgress
        }
    },
    {persist: true})
